<template>
	<view class="pagesbg">
		<!-- 头部 -->
		<view class="header_bar header_fixed header_main">
			<view class="header">
				<view class="header-goBack" @tap.stop="$tools.back(1)"></view>
				<view class="header-title">选择自提点</view>
			</view> 
		</view> 
		
		<view class="">
			<view class="pickBox">
				<view class="pickBox-list">
					<view class="pickBox-list__item" v-for="(item,index) in productAddress" :key="index">
						<!-- <image src="../../static/public/addr-2.png" mode=""></image> -->
						<image :src="item.image ? item.image : '../../static/public/addr-2.png'" mode=""></image>
						<view class="content">
							<view class="addr">{{ item.address }}</view>
							<view class="phone">
								{{ item.storePhone | conceal(4) }}
								<text class="copy" @tap.stop="$tools.copy(item.storePhone)">复制</text>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		components:{
		},
		data(){
			return{
				productAddress: [],
			}
		},
		onLoad() {
			
		},
		onShow() {
			this.init();
		},
		methods: {
			init(){
				this.productAddress = [];
				this.getProductAddress();
			},
			// 商品自提点
			getProductAddress(){
				var data = {};
				data['productId'] = this.goodsId;
				this.$Ajax('/api/order/getProductAddress',data,res => {
						if (res.code == 200) {
							this.productAddress = res.data;
						}
					}, err =>{
					}, 'GET'
				)
			},
		}
	}
</script>

<style lang="scss" scoped>
	
	.pickBox{
		&-list{
			@include flexLeftColumn;
			padding: 0 20rpx;
			&__item{
				@include flexLeft;
				background: #FFFFFF;
				border-radius: 12rpx;
				padding: 34rpx 34rpx 32rpx;
				margin-top: 10rpx;
				width: 100%;
				image{
					width: 98rpx;
					height: 98rpx;
					margin-right: 42rpx;
				}
				.content{
					width: calc(100% - 98rpx - 42rpx);
					@include flexLeftColumn;
					.addr{
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						font-size: 28rpx;
						color: #131414;
						margin-bottom: 24rpx;
					}
					.phone{
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						font-size: 28rpx;
						color: #131414;
						.copy{
							font-family: PingFang SC, PingFang SC;
							font-weight: 400;
							font-size: 24rpx;
							color: #1989F8;
							margin-left: 20rpx;
							padding-bottom: 3rpx;
							border-bottom: 1px solid #1989F8;
						}
					}
				}
			}
		}
	}
</style>